package com.wisezone.HomeWork.home04;

public class ThreadWindowOne extends Thread {
    private static int tickets = 100;

    @Override
    public void run() {
//        super.run();
        while (true) {
            if (tickets > 0) {
                System.out.println(Thread.currentThread().getName() + "正在售票...票号为：" + tickets--);
            } else {
                break;
            }
        }
    }


    public static void main(String[] args) {
        ThreadWindowOne one = new ThreadWindowOne();
        ThreadWindowOne two = new ThreadWindowOne();
        ThreadWindowOne three = new ThreadWindowOne();
        one.start();
        two.start();
        three.start();
    }
}
